"""
扫描模式页面
"""
import sys

import uiautomation as auto
from utils.utils_log import loggerCase
from page.base_page import BasePage

class ScanModePage(BasePage):

    """
    扫描模式页面
    """

    # Trak模式
    __trak_mode = auto.ButtonControl(SubName="Trak Mode")

    # LASER模式
    __laser_mode = auto.ButtonControl(SubName="Laser Mode")

    # 工程名输入框
    __name_editor = auto.EditControl(foundIndex=1)

    def click_trak_mode(self):
        """点击跟踪模式"""
        loggerCase.info("点击跟踪模式")
        self.click(self.__trak_mode, max_wait_time=5)
        self.loading()

    def click_laser_mode(self):
        """点击激光模式"""
        loggerCase.info("点击激光模式")
        self.click(self.__laser_mode, max_wait_time=5)
        self.loading()

    def edit_name_editor(self, text):
        """编辑文件名称"""
        loggerCase.info("文件名称为" + text)
        self.send_key(self.__name_editor, text)

